package com.hzw.saas.api.hpc.enums;

import java.util.Objects;

/**
 * @author sonam
 * @sine 2021/8/23 10:04 上午
 */
public enum HpcContractType {
    FORMAL(1, "正式合同"),
    TRIAL(2, "试用合同"),
    ;
    private final Integer value;
    private final String text;

    HpcContractType(Integer value, String text) {
        this.value = value;
        this.text = text;
    }

    public Integer value() {
        return value;
    }

    public String text() {
        return text;
    }

    public static HpcContractType text(Integer value) {
        for (HpcContractType contractType : HpcContractType.values()) {
            if (Objects.equals(contractType.value, value)) {
                return contractType;
            }
        }
        return null;
    }

    public static HpcContractType instance(Integer value) {
        for (HpcContractType contractType : HpcContractType.values()) {
            if (Objects.equals(contractType.value, value)) {
                return contractType;
            }
        }
        return null;
    }
}
